/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.zx.mockexam.theory.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.TreeService;
import com.jeesite.modules.zx.mockexam.theory.entity.TmockexamTheory;
import com.jeesite.modules.zx.mockexam.theory.dao.TmockexamTheoryDao;
import com.jeesite.modules.file.utils.FileUploadUtils;

/**
 * 理论模拟考试对象表Service
 * @author zpp
 * @version 2020-02-09
 */
@Service
@Transactional(readOnly=true)
public class TmockexamTheoryService extends TreeService<TmockexamTheoryDao, TmockexamTheory> {
	
	/**
	 * 获取单条数据
	 * @param tmockexamTheory
	 * @return
	 */
	@Override
	public TmockexamTheory get(TmockexamTheory tmockexamTheory) {
		return super.get(tmockexamTheory);
	}
	
	/**
	 * 查询列表数据
	 * @param tmockexamTheory
	 * @return
	 */
	@Override
	public List<TmockexamTheory> findList(TmockexamTheory tmockexamTheory) {
		return super.findList(tmockexamTheory);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param tmockexamTheory
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(TmockexamTheory tmockexamTheory) {
		super.save(tmockexamTheory);
		// 保存上传图片
		FileUploadUtils.saveFileUpload(tmockexamTheory.getId(), "tmockexamTheory_image");
		// 保存上传附件
		FileUploadUtils.saveFileUpload(tmockexamTheory.getId(), "tmockexamTheory_file");
	}
	
	/**
	 * 更新状态
	 * @param tmockexamTheory
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(TmockexamTheory tmockexamTheory) {
		super.updateStatus(tmockexamTheory);
	}
	
	/**
	 * 删除数据
	 * @param tmockexamTheory
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(TmockexamTheory tmockexamTheory) {
		dao.phyDelete(tmockexamTheory);
		//super.delete(tmockexamTheory);
	}
	
}